home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / ntscboot < prev    next >
Encoding:
Internet Message Format  |  1990-03-15  |  8.0 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i113: NTSCBoot - reboot into PAL or NTSC mode, Part01/01
  5. Message-ID: <11803@xanth.cs.odu.edu>
  6. Date: 15 Mar 90 01:33:52 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: johnf%ssl.Berkeley.EDU@jade.berkeley.edu (John Flanagan)
  9. Lines: 204
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: johnf%ssl.Berkeley.EDU@jade.berkeley.edu (John Flanagan)
  15. Posting-number: Volume 90, Issue 113
  16. Archive-name: util/ntscboot
  17.  
  18. [ uuencoded executables enclosed.  ...tad ]
  19.  
  20. This contains source, binary and docs for NTSCboot, which Udi Finkelstein
  21. wrote and posted to comp.sys.amiga.tech last week.  This is a program which
  22. reboots PAL Amigas into NTSC mode, if they have the 1-Meg Agnus and Kickstart
  23. 1.3.  I have also addeda version of NTSCboot which I zapped to create PALboot,
  24. which boots NTSC Amigas into PAL mode.
  25.  
  26. All credit goes to Udi Finkelstein (finkel%math.tau.ac.il@CUNYVM.CUNY.EDU).  I
  27. was going to try to rewrite these in a more legal manner, such that it would
  28. not need to jump to code on the ROMs, but this does not seem to be possible
  29. given the fact that system RAM is scrammed from the bus upon reset.  Oh well.
  30.  
  31. John
  32.  
  33. #!/bin/sh
  34. # This is a shell archive.  Remove anything before this line, then unpack
  35. # it by saving it into a file and typing "sh file".  To overwrite existing
  36. # files, type "sh file -c".  You can also feed this as standard input via
  37. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  38. # will see the following message at the end:
  39. #        "End of archive 1 (of 1)."
  40. # Contents:  NTSCBoot.uu NTSCboot.asm PALBoot.uu README
  41. # Wrapped by tadguy@xanth on Wed Mar 14 20:33:35 1990
  42. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  43. if test -f 'NTSCBoot.uu' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'NTSCBoot.uu'\"
  45. else
  46. echo shar: Extracting \"'NTSCBoot.uu'\" \(132 characters\)
  47. sed "s/^X//" >'NTSCBoot.uu' <<'END_OF_FILE'
  48. Xbegin 644 NTSCBoot
  49. XM```#\P`````````!```````````````(```#Z0````@L>``$3J[_:D?Y`-_Q0
  50. X7HG(`+'@``DOY``-!($YP3M5.<0```_((_
  51. X``
  52. Xend
  53. Xsize 68
  54. END_OF_FILE
  55. if test 132 -ne `wc -c <'NTSCBoot.uu'`; then
  56.     echo shar: \"'NTSCBoot.uu'\" unpacked with wrong size!
  57. fi
  58. # end of 'NTSCBoot.uu'
  59. fi
  60. if test -f 'NTSCboot.asm' -a "${1}" != "-c" ; then 
  61.   echo shar: Will not clobber existing file \"'NTSCboot.asm'\"
  62. else
  63. echo shar: Extracting \"'NTSCboot.asm'\" \(2675 characters\)
  64. sed "s/^X//" >'NTSCboot.asm' <<'END_OF_FILE'
  65. XX;
  66. XX; NTSCBoot.asm
  67. XX;
  68. XX; Copyright (C) 1990 By Udi Finkelstein.
  69. XX; 17 feb 1990
  70. XX;
  71. XX; Reboot a SuperAgnus equipped PAL machine into NTSC mode.
  72. XX;
  73. XX; With thanks to Bart Whitebrook from CBM for his article on the new ECS
  74. XX; registers in the 3rd european DevCon notes!
  75. XX
  76. XX; get into supervisor state, since we can only execute RESET there.
  77. XX       xref    _LVOSuperState
  78. XX       move.l  4,a6
  79. XX       jsr     _LVOSuperState(a6)
  80. XX
  81. XX; ************************************
  82. XX; Warning!!! a grand hack ahead!!!!!!!
  83. XX; Never do this stuff alone at home!!!
  84. XX; ************************************
  85. XX
  86. XX; Now we are in supervisor mode, and can issue a RESET command.
  87. XX; Unfortunately, after RESET there is no RAM in the system!
  88. XX; We can issue exacly *one* instruction ( 1 word length ) because
  89. XX; the instruction was fetched before RESET was executed. This
  90. XX; instruction can be a 'jmp (aX)', to somewhere on the ROM, where the
  91. XX; program can continue. After searching the Kickstart 1.3 ROM, I found
  92. XX; that at address $ff4120 you can find the code:
  93. XX
  94. XX; [ Notice - for Kickstart 1.3 ***ONLY***!!! Is there anybody out there
  95. XX;   with a Kickstart 1.2/super Agnus combination? you have a problem! ;-) ]
  96. XX
  97. XX;00FF4120 2741 0038              move.l  d1,$38(a3)
  98. XX;00FF4124 4281                   clr.l   d1
  99. XX;00FF4126 4ED6                   jmp     (a6)
  100. XX
  101. XX; We can use this code fragment to set the NTSC bit in the super agnus,
  102. XX; and then jump to the reset code. The PAL/NTSC bit is contained in
  103. XX; address $DFF1DC   (BEAMCON0 !).
  104. XX;
  105. XX; 'move.l d1,$38(a3)' writes a longword, therefor $38(a3) must point to
  106. XX; $dff1da because it's a read only location, which we can't harm, and
  107. XX; $dff1dc contains the PAL/NTSC bit.
  108. XX; $38(a3) == $dff1da   -->  a3 == $ddf1a2
  109. XX; we must reset d1 ofcourse, or set d1 == #$00000020 to set PAL mode.
  110. XX;
  111. XX; ofcourse we have to set a6 to $00000002 to run the reset code later.
  112. XX;
  113. XX
  114. XXROMADR =       ($ff4120-$fc0000)
  115. XX
  116. XX; ROMADR points to $ff4120 after the ROM appears in address $0000.
  117. XX
  118. XX       lea.l   $dff1a2,a3
  119. XX       move.l  #$0,d1
  120. XX       move.l  2,a6
  121. XX       cnop    0,4
  122. XX       lea.l   ROMADR,a5
  123. XX       RESET                   ;reset the machine...
  124. XX       jmp     (a5)            ;execute our code fragment.
  125. XX
  126. XX; Well, that's it. I tried writing a more portable code by trying to
  127. XX; set/reset the OVL bit in $BFE001 instead of 'jmp (aX)' after RESET,
  128. XX; but I wasn't able to get it working, so the only way I found to run
  129. XX; a code after RESET is to find a ROM fragment that happenes to match
  130. XX; my requirement. You don't have to tell me how bad it is. Hopefully,
  131. XX; the 1.4 preferences will have a PAL/NTSC software switch ( Will it?!!)
  132. XX
  133. XX       END
  134. END_OF_FILE
  135. if test 2675 -ne `wc -c <'NTSCboot.asm'`; then
  136.     echo shar: \"'NTSCboot.asm'\" unpacked with wrong size!
  137. fi
  138. # end of 'NTSCboot.asm'
  139. fi
  140. if test -f 'PALBoot.uu' -a "${1}" != "-c" ; then 
  141.   echo shar: Will not clobber existing file \"'PALBoot.uu'\"
  142. else
  143. echo shar: Extracting \"'PALBoot.uu'\" \(131 characters\)
  144. sed "s/^X//" >'PALBoot.uu' <<'END_OF_FILE'
  145. Xbegin 664 PALBoot
  146. XM```#\P`````````!```````````````(```#Z0````@L>``$3J[_:D?Y`-_Q0
  147. X7HG(@+'@``DOY``-!($YP3M5.<0```_((?
  148. X``
  149. Xend
  150. Xsize 68
  151. END_OF_FILE
  152. if test 131 -ne `wc -c <'PALBoot.uu'`; then
  153.     echo shar: \"'PALBoot.uu'\" unpacked with wrong size!
  154. fi
  155. # end of 'PALBoot.uu'
  156. fi
  157. if test -f 'README' -a "${1}" != "-c" ; then 
  158.   echo shar: Will not clobber existing file \"'README'\"
  159. else
  160. echo shar: Extracting \"'README'\" \(1245 characters\)
  161. sed "s/^X//" >'README' <<'END_OF_FILE'
  162. XHello everyone,
  163. X
  164. XThis is a program I wrote last night to reboot a PAL machine into
  165. XNTSC mode. You must have the new Agnus chip, and Kickstart 1.3 .
  166. XThe program relies on static location of certain Kickstart 1.3
  167. XROM instructions, so it MUST be modified for Kickstart 1.2 . Are there
  168. Xany users of the new Agnus chip users with Kickstart 1.2??
  169. X
  170. XThe program has been tested on a PAL A500 with a super Agnus chip,
  171. Xa fully populated A590, Kickstart 1.3 ROM, and a Rev 3 motherboard
  172. Xhacked to contain the super Agnus chip.
  173. X
  174. XThe program should work as is on 2000's as well, but I didn't
  175. Xtest it. Again, it will *not* work with Kickstart 1.2 .
  176. X
  177. XThe program can be easily modified to reboot an NTSC machine in PAL
  178. Xmode, but I remember reading that the american monitors can't work
  179. Xin PAL mode, while the european monitors can work in both modes.
  180. X( This was verified by me ;-) ).
  181. X
  182. XI could modify it to be more user-friendly ( find the appropriate
  183. Xaddress in the Kickstart ROM at run time, etc. ), but I was too
  184. Xlazy to do this ;-) ( actually, I had an exam the next morning so I
  185. Xdidn't have too much time improving it ).
  186. X
  187. XSince our Usenet connection has been down for the last 3 weeks, any
  188. Xcomments should be mailed to me directly, and not posted.
  189. X
  190. XEnjoy!
  191. END_OF_FILE
  192. if test 1245 -ne `wc -c <'README'`; then
  193.     echo shar: \"'README'\" unpacked with wrong size!
  194. fi
  195. # end of 'README'
  196. fi
  197. echo shar: End of archive 1 \(of 1\).
  198. cp /dev/null ark1isdone
  199. MISSING=""
  200. for I in 1 ; do
  201.     if test ! -f ark${I}isdone ; then
  202.     MISSING="${MISSING} ${I}"
  203.     fi
  204. done
  205. if test "${MISSING}" = "" ; then
  206.     echo You have the archive.
  207.     rm -f ark[1-9]isdone
  208. else
  209.     echo You still need to unpack the following archives:
  210.     echo "        " ${MISSING}
  211. fi
  212. ##  End of shell archive.
  213. exit 0
  214. -- 
  215. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  216. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  217. Post requests for sources, and general discussion to comp.sys.amiga.
  218.